<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libwkhtmltox: Setting</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libwkhtmltox
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Setting </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Settings can be supplied to PDF and image c-bindings using utf-8 encoded strings. This is done by relatively simple reflection on the CropSettings, HeaderFooter, Margin, ImageGlobal, PdfGlobal, PdfObject, Size, and TableOfContent classes.</p>
<ul>
<li>The <a class="el" href="structwkhtmltopdf__global__settings.html">wkhtmltopdf_global_settings</a> corresponds to the PdfGlobal class and is documented in <a class="el" href="pagesettings.html#pagePdfGlobal">Pdf global settings</a>.</li>
<li>The <a class="el" href="structwkhtmltopdf__object__settings.html">wkhtmltopdf_object_settings</a> corresponds to the PdfGlobal class and is documented in <a class="el" href="pagesettings.html#pagePdfObject">Pdf object settings</a>.</li>
<li>The wkhtmltopdf_image_settings corresponds to the ImageGlobal class and is documented in <a class="el" href="pagesettings.html#pageImageGlobal">Image settings</a>.</li>
</ul>
<h1><a class="anchor" id="pageWeb"></a>
Web page specific settings</h1>
<p>The following web page specific settings apply</p><ul>
<li><b>web.background</b> Should we print the background? Must be either "true" or "false".</li>
<li><b>web.loadImages</b> Should we load images? Must be either "true" or "false".</li>
<li><b>web.enableJavascript</b> Should we enable javascript? Must be either "true" or "false".</li>
<li><b>web.enableIntelligentShrinking</b> Should we enable intelligent shrinkng to fit more content on one page? Must be either "true" or "false". Has no effect for wkhtmltoimage.</li>
<li><b>web.minimumFontSize</b> The minimum font size allowed. E.g. "9"</li>
<li><b>web.printMediaType</b> Should the content be printed using the print media type instead of the screen media type. Must be either "true" or "false". Has no effect for wkhtmltoimage.</li>
<li><b>web.defaultEncoding</b> What encoding should we guess content is using if they do not specify it properly? E.g. "utf-8"</li>
<li><b>web.userStyleSheet</b> Url er path to a user specified style sheet.</li>
<li><b>web.enablePlugins</b> Should we enable NS plugins, must be either "true" or "false". Enabling this will have limited success.</li>
</ul>
<h1><a class="anchor" id="pageLoad"></a>
Object Specific loading settings</h1>
<p>The following settings apply for object loading.</p><ul>
<li><b>load.username</b> The user name to use when loging into a website, E.g. "bart"</li>
<li><b>load.password</b> The password to used when logging into a website, E.g. "elbarto"</li>
<li><b>load.jsdelay</b> The mount of time in milliseconds to wait after a page has done loading until it is actually printed. E.g. "1200". We will wait this amount of time or until, javascript calls window.print().</li>
<li><b>load.zoomFactor</b> How much should we zoom in on the content? E.g. "2.2".</li>
<li><b>load.customHeaders</b> TODO</li>
<li><b>load.repertCustomHeaders</b> Should the custom headers be sent all elements loaded instead of only the main page? Must be either "true" or "false".</li>
<li><b>load.cookies</b> TODO</li>
<li><b>load.post</b> TODO</li>
<li><b>load.blockLocalFileAccess</b> Disallow local and piped files to access other local files. Must be either "true" or "false".</li>
<li><b>load.stopSlowScript</b> Stop slow running javascript. Must be either "true" or "false".</li>
<li><b>load.debugJavascript</b> Forward javascript warnings and errors to the warning callback. Must be either "true" or "false".</li>
<li><b>load.loadErrorHandling</b> How should we handle obejcts that fail to load. Must be one of:<ul>
<li>"abort" Abort the conversion process</li>
<li>"skip" Do not add the object to the final output</li>
<li>"ignore" Try to add the object to the final output.</li>
</ul>
</li>
<li><b>load.proxy</b> String describing what proxy to use when loading the object.</li>
<li><b>load.runScript</b> TODO</li>
</ul>
<h1><a class="anchor" id="pageHeaderFooter"></a>
Header and footer settings</h1>
<p>The same settings can be applied for headers and footers, here there are explained in terms of the header.</p><ul>
<li><b>header.fontSize</b> The font size to use for the header, e.g. "13"</li>
<li><b>header.fontName</b> The name of the font to use for the header. e.g. "times"</li>
<li><b>header.left</b> The string to print in the left part of the header, note that some sequences are replaced in this string, see the wkhtmltopdf manual.</li>
<li><b>header.center</b> The text to print in the center part of the header.</li>
<li><b>header.right</b> The text to print in the right part of the header.</li>
<li><b>header.line</b> Whether a line should be printed under the header (either "true" or "false").</li>
<li><b>header.spacing</b> The amount of space to put between the header and the content, e.g. "1.8". Be aware that if this is too large the header will be printed outside the pdf document. This can be corrected with the margin.top setting.</li>
<li><b>header.htmlUrl</b> Url for a HTML document to use for the header.</li>
</ul>
<h1><a class="anchor" id="pagePdfGlobal"></a>
Pdf global settings</h1>
<p>The <a class="el" href="structwkhtmltopdf__global__settings.html">wkhtmltopdf_global_settings</a> structure contains the following settings:</p><ul>
<li><b>size.pageSize</b> The paper size of the output document, e.g. "A4".</li>
<li><b>size.width</b> The with of the output document, e.g. "4cm".</li>
<li><b>size.height</b> The height of the output document, e.g. "12in".</li>
<li><b>orientation</b> The orientation of the output document, must be either "Landscape" or "Portrait".</li>
<li><b>colorMode</b> Should the output be printed in color or gray scale, must be either "Color" or "Grayscale"</li>
<li><b>resolution</b> Most likely has no effect.</li>
<li><b>dpi</b> What dpi should we use when printing, e.g. "80".</li>
<li><b>pageOffset</b> A number that is added to all page numbers when printing headers, footers and table of content.</li>
<li><b>copies</b> How many copies should we print?. e.g. "2".</li>
<li><b>collate</b> Should the copies be collated? Must be either "true" or "false".</li>
<li><b>outline</b> Should a outline (table of content in the sidebar) be generated and put into the PDF? Must be either "true" or false".</li>
<li><b>outlineDepth</b> The maximal depth of the outline, e.g. "4".</li>
<li><b>dumpOutline</b> If not set to the empty string a XML representation of the outline is dumped to this file.</li>
<li><b>out</b> The path of the output file, if "-" output is sent to stdout, if empty the output is stored in a buffer.</li>
<li><b>documentTitle</b> The title of the PDF document.</li>
<li><b>useCompression</b> Should we use loss less compression when creating the pdf file? Must be either "true" or "false".</li>
<li><b>margin.top</b> Size of the top margin, e.g. "2cm"</li>
<li><b>margin.bottom</b> Size of the bottom margin, e.g. "2cm"</li>
<li><b>margin.left</b> Size of the left margin, e.g. "2cm"</li>
<li><b>margin.right</b> Size of the right margin, e.g. "2cm"</li>
<li><b>imageDPI</b> The maximal DPI to use for images in the pdf document.</li>
<li><b>imageQuality</b> The jpeg compression factor to use when producing the pdf document, e.g. "92".</li>
<li><b>load.cookieJar</b> Path of file used to load and store cookies.</li>
</ul>
<h1><a class="anchor" id="pagePdfObject"></a>
Pdf object settings</h1>
<p>The <a class="el" href="structwkhtmltopdf__object__settings.html">wkhtmltopdf_object_settings</a> structure contains the following settings:</p><ul>
<li><b>toc.useDottedLines</b> Should we use a dotted line when creating a table of content? Must be either "true" or "false".</li>
<li><b>toc.captionText</b> The caption to use when creating a table of content.</li>
<li><b>toc.forwardLinks</b> Should we create links from the table of content into the actual content? Must be either "true or "false.</li>
<li><b>toc.backLinks</b> Should we link back from the content to this table of content.</li>
<li><b>toc.indentation</b> The indentation used for every table of content level, e.g. "2em".</li>
<li><b>toc.fontScale</b> How much should we scale down the font for every toc level? E.g. "0.8"</li>
<li><b>page</b> The URL or path of the web page to convert, if "-" input is read from stdin.</li>
<li><b>header</b>.* Header specific settings see <a class="el" href="pagesettings.html#pageHeaderFooter">Header and footer settings</a>.</li>
<li><b>footer</b>.* Footer specific settings see <a class="el" href="pagesettings.html#pageHeaderFooter">Header and footer settings</a>.</li>
<li><b>useExternalLinks</b> Should external links in the HTML document be converted into external pdf links? Must be either "true" or "false.</li>
<li><b>useLocalLinks</b> Should internal links in the HTML document be converted into pdf references? Must be either "true" or "false"</li>
<li><b>replacements</b> TODO</li>
<li><b>produceForms</b> Should we turn HTML forms into PDF forms? Must be either "true" or file".</li>
<li><b>load</b>.* Page specific settings related to loading content, see <a class="el" href="pagesettings.html#pageLoad">Object Specific loading settings</a>.</li>
<li><b>web</b>.* See <a class="el" href="pagesettings.html#pageWeb">Web page specific settings</a>.</li>
<li><b>includeInOutline</b> Should the sections from this document be included in the outline and table of content?</li>
<li><b>pagesCount</b> Should we count the pages of this document, in the counter used for TOC, headers and footers?</li>
<li><b>tocXsl</b> If not empty this object is a table of content object, "page" is ignored and this xsl style sheet is used to convert the outline XML into a table of content.</li>
</ul>
<h1><a class="anchor" id="pageImageGlobal"></a>
Image settings</h1>
<p>The wkhtmltoimage_global_settings structure contains the following settings:</p><ul>
<li><b>crop.left</b> left/x coordinate of the window to capture in pixels. E.g. "200"</li>
<li><b>crop.top</b> top/y coordinate of the window to capture in pixels. E.g. "200"</li>
<li><b>crop.width</b> Width of the window to capture in pixels. E.g. "200"</li>
<li><b>crop.height</b> Height of the window to capture in pixels. E.g. "200"</li>
<li><b>load.cookieJar</b> Path of file used to load and store cookies.</li>
<li><b>load</b>.* Page specific settings related to loading content, see <a class="el" href="pagesettings.html#pageLoad">Object Specific loading settings</a>.</li>
<li><b>web</b>.* See <a class="el" href="pagesettings.html#pageWeb">Web page specific settings</a>.</li>
<li><b>transparent</b> When outputting a PNG or SVG, make the white background transparent. Must be either "true" or "false"</li>
<li><b>in</b> The URL or path of the input file, if "-" stdin is used. E.g. "http://google.com"</li>
<li><b>out</b> The path of the output file, if "-" stdout is used, if empty the content is stored to a internalBuffer.</li>
<li><b>fmt</b> The output format to use, must be either "", "jpg", "png", "bmp" or "svg".</li>
<li><b>screenWidth</b> The with of the screen used to render is pixels, e.g "800".</li>
<li><b>smartWidth</b> Should we expand the screenWidth if the content does not fit? must be either "true" or "false".</li>
<li><b>quality</b> The compression factor to use when outputting a JPEG image. E.g. "94". </li>
</ul>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
